package TEST;


import static org.junit.Assert.*;

import java.io.IOException;

import org.junit.Before;
import org.junit.Test;

import Server.Sessions.ActiveSessions;
import Server.Sessions.ClientSession;

public class ActiveSessionsTest {
	ActiveSessions as;
	@Before
	public void setUp() throws Exception {
		as = new ActiveSessions();		
	}
	
	@Test
	public void sessionListSizeTestZero() throws IOException{
		assertEquals(0,as.sessionListSize());
	}
	
	@Test
	public void sessionListSizeTestOne() throws IOException{
		ClientSession c = new ClientSession(null,null,null);
		as.addSession(c);
		assertEquals(1,as.sessionListSize());
	}
	
	@Test
	public void sessionListSizeTestTwo() throws IOException{
		ClientSession c1 = new ClientSession(null,null,null);
		ClientSession c2 = new ClientSession(null,null,null);
		as.addSession(c1);
		as.addSession(c2);
		assertEquals(2,as.sessionListSize());
	}
}
